package com.gxa.service.impl;

import com.gxa.common.R;
import com.gxa.mapper.ThreeMapper;
import com.gxa.service.ThreeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: 周林森
 * Date: 2021/12/07 16:41:11
 * Description: 仓库、职员和账户管理 业务
 * Version: V1.0
 */
@Service
public class ThreeServiceImpl implements ThreeService {

    @Autowired(required = false)
    private ThreeMapper threeMapper;

    //添加仓库
    @Override
    public R addWarehouse(Object warehouse_name) {
        int i = threeMapper.addWarehouse(warehouse_name);
        return new R(200,"添加仓库成功");
    }

    //删除仓库
    @Override
    public R delWarehouse(Object warehouse_id) {
        int i = threeMapper.delWarehouse(warehouse_id);
        return new R(200,"删除仓库成功");
    }

    //删除职员
    @Override
    public R delStaff(Object staff_member_id) {
        int i = threeMapper.delStaff(staff_member_id);
        return new R(200,"删除职员成功");
    }

    //删除账户
    @Override
    public R delAccount(Object account_id) {
        int i = threeMapper.delAccount(account_id);
        return new R(200,"删除账户成功");
    }

    //添加职员
    @Override
    public R addStaff(Object staff_member_name) {
        threeMapper.addStaff(staff_member_name);
        return new R(200,"添加职员成功");
    }

    //添加账户
    @Override
    public R addAccount(Map account_manage) {
        threeMapper.addAccount(account_manage);
        return new R(200,"添加账户成功");
    }

    //修改仓库
    @Override
    public R updateWarehouse(Object warehouse_id, Object warehouse_name) {
        int i = threeMapper.updateWarehouse(warehouse_id,warehouse_name);
        return new R(200,"修改账户成功");
    }

    //修改职员
    @Override
    public R updateStaff(Object staff_member_id, Object staff_member_name) {
        int i = threeMapper.updateStaff(staff_member_id,staff_member_name);
        return new R(200,"修改职员成功");
    }

    @Override
    public R updateAccount(Map account_manage) {
        threeMapper.updateAccount(account_manage);
        return new R(200, "修改账户成功");
    }
}
